/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function Salle(name, infos, machines){
    this.name = name;
    this.infos = infos;
    this.machines = machines;
    this.id = null;
    
    this.getId = function(){
        return this.id;
    };
    this.setId = function(id){
        this.id = id;
    };
    this.getName = function(){
        return this.name;
    };
    this.setName = function(name){
        this.name = name;
    };
    this.getInfos = function(){
        return this.infos;
    };
    this.setInfos = function(infos){
        this.infos = infos;
    };
    this.getMachines = function(){
        return this.machines;
    };
    this.setMachines = function(machines){
        this.machines = machines;
    };
    this.addMachine = function(machine){
        this.machines.push(machine);
    };
    this.loadJson = function(json){
        this.name = json["name"];
        this.id = json["id"];
        this.infos = json["infos"];
        this.machines = Array();
        var machines = json["machines"];
        for(var i = 0 ; i<machines.length; i++){
            var machine = machines[i];
            var jMachine = new Machine("","",0,0);
            jMachine.loadJson(machine);
            this.addMachine(jMachine)
        }
    }
}